package com.sf.dlb.jpa.repository;

import com.sf.dlb.jpa.model.SysUserInfo;
import com.sf.dlb.jpa.model.UserInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

/**
 * 后台管理用户 Repository
 *
 * Created by jing.tan on 2018/12/10.
 */
@Repository
public interface SysUserRepository extends JpaRepository<SysUserInfo, Long> {
    /**
     * 根据登录名查询
     * @param loginName
     * @param delFlag
     * @return
     */
    SysUserInfo findByLoginNameAndDelFlag(String loginName, String delFlag);

    /**
     * 根据用户ID查询
     * @return
     */
    SysUserInfo findByIdAndDelFlag(Long id, String delFlag);
    /**
     * 根据token查询用户
     * @return
     */
    SysUserInfo findByTokenAndDelFlag(String token, String delFlag);
}